<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/admin_common.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__/admin_main.css"/>
    <script type="text/javascript" src="__JS__/modernizr.min.js"></script>
    <script type="text/javascript" src="__JS__/jquery-1.8.0.min.js"></script>
</head>
<body>
<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <!-- <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1> -->
            <img style="height:50px;display:block;overflow:hidden;" src="__IMG__/logo_mall.jpg" alt="">
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <!-- <li><a href="#">管理员</a></li> -->
                <!-- <li><a href="#">修改密码</a></li> -->
                <li><a href="<?php echo U('Admin/Public/loginout');?>">退出</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
            <ul class="sidebar-list">
                <!--<li>
                    <a href="<?php echo U('Admin/Index/index');?>"><i class="icon-font">&#xe003;</i>常用操作</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Admin/Adminuser/index');?>">用户管理</a></li>
                        <li><a href="<?php echo U('Admin/Express/index');?>">物流商户管理</a></li>
                        <li><a href="<?php echo U('Admin/Goods/index');?>">商品列表</a></li>

                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('Admin/Prize/index');?>"><i class="icon-font">&#xe003;</i>配送管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Admin/Prize/unsend');?>">未配送管理</a></li>
                        <li><a href="<?php echo U('Admin/Prize/hassend');?>">已配送管理</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>结算管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Admin/Prize/LTbalance');?>">联通已结算订单</a></li>
                        <li><a href="<?php echo U('Admin/Prize/WLbalance');?>">物流已结算订单</a></li>
                    </ul>
                </li>-->
                <?php foreach($menu['main'] as $k1=>$v1){ echo '<li>'; echo '<a href="'.$v1[url].'"><i class="icon-font">&#xe003;</i>'.$v1[title].'</a>'; if($menu['sub'][$k1]){ echo '<ul class="sub-menu">'; foreach($menu['sub'][$k1] as $k2=>$v2){ echo '<li><a href="'.$v2[url].'">'.$v2[title].'</a></li>'; } echo '</ul>'; } echo '</li>'; } ?>
            </ul>
        </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="/jscss/admin/design/">用户管理</a><span class="crumb-step">&gt;</span><span>新增/修改用户</span></div>
    </div>
    <div class="result-wrap">
        <div class="result-content">
            <form action="<?php echo U('Adminuser/set');?>" method="post" id="myform" name="myform" onsubmit="return check();">
                <input type="hidden" name="id" value="<?php echo ($data["id"]); ?>">
                <input type="hidden" name="act" value="<?php echo ($act); ?>">
                <table class="insert-tab" width="100%">
                    <tbody>
                    
                    <tr>
                        <th width="120"><i class="require-red">*</i>用户名：</th>
                        <td>
                            <input class="common-text required" name="username" size="30" value="<?php echo ($data["username"]); ?>" type="text">
                            <span class="notice red hiden" for="username">请填写用户名</span>
                        </td>
                    </tr>
                    <tr>
                        <th width="120"><i class="require-red">*</i>真实姓名：</th>
                        <td>
                            <input class="common-text required"  name="realname" size="30" value="<?php echo ($data["realname"]); ?>" type="text">
                            <span class="notice red hiden" for="realname">请填写真实姓名</span>
                        </td>
                    </tr>
                    <tr>
                        <th width="120"><i class="require-red">*</i>角色：</th>
                        <td>
                            <?php echo frm_out_put($role,'role','option',$data['roleid']);?>
                            <span class="notice red hiden" for="role">请选择角色</span>
                        </td>
                    </tr>
                    <tr class="exp-td" style="display: none;">
                        <th width="120"><i class="require-red">*</i>快递类型：</th>
                        <td>

                            <?php echo frm_out_put($express,'express','option',$data['attr']);?>
                            <span class="notice red hiden" for="express">请选择快递类型</span>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>密码：</th>
                        <td>
                            <input class="common-text" name="password" size="30" type="password" value="">
                            <span class="notice red hiden" for="password">请填写密码</span>
                        </td>
                    </tr>
                    <?php if($act == 'add'): ?><tr>
                            <th><i class="require-red">*</i>重复密码：</th>
                            <td>
                                <input class="common-text" name="repassword" size="30" type="password" value="<?php echo ($data["repassword"]); ?>">
                                <span class="notice red hiden" for="repassword">请填写再次确认密码</span>
                            </td>
                        </tr><?php endif; ?>
                    <tr>
                        <th></th>
                        <td>
                            <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                            <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>

</div>
<script type="text/javascript">
    
    function check()
    {
        var username = $('input[name=username]').val(),
            realname = $('input[name=realname]').val(),
            password = $('input[name=password]').val(),
            repassword = $('input[name=repassword]').val(),
            act = $('input[name=act]').val();
        var error = true;
        if(username=='')
        {
            showMsg($('span[for=username]'),true,'');error=false;
        }
        if(realname=='')
        {
            showMsg($('span[for=realname]'),true,'');error=false;
        }
        if(password=='' && act == 'add')
        {
            showMsg($('span[for=password]'),true,'');error=false;
        }
        if(act == 'add')
        {
            if(password != repassword)
            {
                showMsg($('span[for=repassword]'),true,'两次密码不一致');error=false;
            }
        }
        
        return error;
    }

    $('#role').change(function(){
        //快递
        if($(this).val()==3){
            $('.exp-td').show();
        }else{
            $('.exp-td').hide();
        }
    });
    /*window.setTimeOut(function(){
        $('.notice').hide();
    },3000);*/
</script>
    <!--/main-->
</div>
</body>
</html>
<script type="text/javascript" src="__JS__/main.js"></script>